dgb(phase-b): extract PPLNS payout-split SSOT (weights -> consensus-sorted payout outputs) - #328
Merged
Merged
Conversation
This was referenced Jun 22, 2026
…orted payout outputs) Lift steps 2-3 of share_check.hpp generate_share_transaction (PPLNS amount math + consensus output ordering) into a pure, tracker-free helper coin/pplns_payout_split.hpp: compute_pplns_payout_split(). This is the bridge that lets the per-connection Stratum coinbase assembler draw the SAME payout amount split the share verification SSOT enforces, so emission and verification cannot diverge on a satoshi. Additive/fenced: nothing calls it yet (no behavior change). Follow-ons: (1) delegate generate_share_transaction to it (byte-identity), (2) wire it into DGBWorkSource::build_connection_coinbase feeding ConnCoinbaseInputs.payout_outputs. KAT dgb_pplns_payout_split_test: V36 exact amounts + >=1 sat donation floor, pre-V36 amounts + 0.5%% finder fee, empty-weights bootstrap, zero-amount drop; all against hand-computed p2pool v36 data.py oracle vectors. Registered in the test CMakeLists and both build.yml dgb --target allowlists (#143 NOT_BUILT trap).
frstrtr
force-pushed
the
dgb/pplns-payout-split
branch
from
June 22, 2026 14:17
34726f1 to
fb543dc
Compare
frstrtr
added a commit
that referenced
this pull request
Jun 22, 2026
Same bar as the #328 payout-split invariance KAT: prove the #333 lift of generate_share_transaction() step-1 into compute_pplns_weight_walk() moves ZERO weight. Embed the pre-refactor inline walk verbatim as legacy_inline_weight_walk() and assert the helper reproduces it weight-for- weight (per-script weights, total_weight, total_donation_weight) across a battery: V36 decay path, pre-V36 grandparent-start + max_weight cap, donation split, full-donation zero-addr-weight share, the insufficient-depth guard (both throw identically), null/absent parents, and a chain exceeding the real_chain_length window. Each weight map is then fed through the #328 payout-split SSOT and the outputs + donation asserted byte-identical, closing the end-to-end no-payout-satoshi-drifts proof shared by the emission and verification paths. dgb_share_test 28/28.
frstrtr
added a commit
that referenced
this pull request
Jun 22, 2026
build_connection_coinbase_from_pplns delegates the payout split to compute_pplns_payout_split() -- the same helper generate_share_transaction (the share verification path, #329) calls -- instead of taking pre-resolved payout_outputs/donation_amount. The coinbase a miner hashes per-connection and the coinbase the share check enforces are now byte-identical on every payout satoshi by construction: one payout implementation, not two kept in agreement. Pure delegation + field forwarding into build_connection_coinbase_parts; no inline payout arithmetic. dgb-tree-only. 4 delegation-identity KATs (V36, pre-V36 finder fee, segwit/ref forwarding, value anchor); 8/8 green. Stacks on the #328/#329 PPLNS SSOT stack.
frstrtr
added a commit
that referenced
this pull request
Jun 22, 2026
Extract generate_share_transaction() step-1 PPLNS tracker walk into dgb::coin::compute_pplns_weight_walk(), the producer-side counterpart of the steps 2-3 lift in pplns_payout_split.hpp (#328). The share-verification path and the per-connection Stratum coinbase emission path now draw one tracker-walk implementation, so the weight map a miner hashes cannot drift from the one the verifier enforces. Verbatim lift: exact V36 depth-decay vs pre-V36 grandparent-start branch, the data.py insufficient-depth guard, and the block-target/spread max_weight cap are unchanged. Result type is deduced from the tracker (decltype) to avoid the share_tracker.hpp <-> share_check.hpp include cycle. KAT WeightWalkSSOTContract locks the helper contract (verbatim V36 forward + safe-empty on null/absent parent); the unchanged generate_share_transaction fixtures prove value-level byte-identity. dgb_share_test 27/27, dgb_connection_coinbase_test 8/8.
frstrtr
added a commit
that referenced
this pull request
Jun 22, 2026
Same bar as the #328 payout-split invariance KAT: prove the #333 lift of generate_share_transaction() step-1 into compute_pplns_weight_walk() moves ZERO weight. Embed the pre-refactor inline walk verbatim as legacy_inline_weight_walk() and assert the helper reproduces it weight-for- weight (per-script weights, total_weight, total_donation_weight) across a battery: V36 decay path, pre-V36 grandparent-start + max_weight cap, donation split, full-donation zero-addr-weight share, the insufficient-depth guard (both throw identically), null/absent parents, and a chain exceeding the real_chain_length window. Each weight map is then fed through the #328 payout-split SSOT and the outputs + donation asserted byte-identical, closing the end-to-end no-payout-satoshi-drifts proof shared by the emission and verification paths. dgb_share_test 28/28.
frstrtr
added a commit
that referenced
this pull request
Jun 23, 2026
dgb(phase-b): extract PPLNS payout-split SSOT (weights -> consensus-sorted payout outputs)
frstrtr
added a commit
that referenced
this pull request
Jun 23, 2026
build_connection_coinbase_from_pplns delegates the payout split to compute_pplns_payout_split() -- the same helper generate_share_transaction (the share verification path, #329) calls -- instead of taking pre-resolved payout_outputs/donation_amount. The coinbase a miner hashes per-connection and the coinbase the share check enforces are now byte-identical on every payout satoshi by construction: one payout implementation, not two kept in agreement. Pure delegation + field forwarding into build_connection_coinbase_parts; no inline payout arithmetic. dgb-tree-only. 4 delegation-identity KATs (V36, pre-V36 finder fee, segwit/ref forwarding, value anchor); 8/8 green. Stacks on the #328/#329 PPLNS SSOT stack.
frstrtr
added a commit
that referenced
this pull request
Jun 23, 2026
Extract generate_share_transaction() step-1 PPLNS tracker walk into dgb::coin::compute_pplns_weight_walk(), the producer-side counterpart of the steps 2-3 lift in pplns_payout_split.hpp (#328). The share-verification path and the per-connection Stratum coinbase emission path now draw one tracker-walk implementation, so the weight map a miner hashes cannot drift from the one the verifier enforces. Verbatim lift: exact V36 depth-decay vs pre-V36 grandparent-start branch, the data.py insufficient-depth guard, and the block-target/spread max_weight cap are unchanged. Result type is deduced from the tracker (decltype) to avoid the share_tracker.hpp <-> share_check.hpp include cycle. KAT WeightWalkSSOTContract locks the helper contract (verbatim V36 forward + safe-empty on null/absent parent); the unchanged generate_share_transaction fixtures prove value-level byte-identity. dgb_share_test 27/27, dgb_connection_coinbase_test 8/8.
frstrtr
added a commit
that referenced
this pull request
Jun 23, 2026
Same bar as the #328 payout-split invariance KAT: prove the #333 lift of generate_share_transaction() step-1 into compute_pplns_weight_walk() moves ZERO weight. Embed the pre-refactor inline walk verbatim as legacy_inline_weight_walk() and assert the helper reproduces it weight-for- weight (per-script weights, total_weight, total_donation_weight) across a battery: V36 decay path, pre-V36 grandparent-start + max_weight cap, donation split, full-donation zero-addr-weight share, the insufficient-depth guard (both throw identically), null/absent parents, and a chain exceeding the real_chain_length window. Each weight map is then fed through the #328 payout-split SSOT and the outputs + donation asserted byte-identical, closing the end-to-end no-payout-satoshi-drifts proof shared by the emission and verification paths. dgb_share_test 28/28.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Phase B pool/share slice. Lifts steps 2-3 of generate_share_transaction into a pure compute_pplns_payout_split(): weights -> amounts -> consensus-sorted outputs + donation + v36 floor. Additive/fenced, runtime byte-unchanged (no caller wired yet; bridge for build_connection_coinbase gated on #327). KAT 4/4 vs oracle: V36 exact amounts+donation floor, pre-v36 amounts+finder fee, empty-weights all-donation, zero-amount dropped. Build EXIT=0, KAT EXIT=0. HOLD merge (integrator taps with operator push approval).